import { Injectable } from '@nestjs/common'
import { CreateMainDto } from './dto/create-main.dto'
import { UpdateMainDto } from './dto/update-main.dto'
import { LoginDto, RegisterDto } from '../system/auth/dto'
import { UserService } from '../system/user/user.service'
import { ClientInfoDto } from 'src/common/decorators/clientInfo.decorator'

@Injectable()
export class MainService {
  constructor(private readonly userService: UserService) {}

  async register(user: RegisterDto) {
    return await this.userService.register(user)
  }

  async login(user: LoginDto, client: ClientInfoDto) {
    return await this.userService.login(user, client)
  }

  create(createMainDto: CreateMainDto) {
    return 'This action adds a new main'
  }

  findAll() {
    return `This action returns all main`
  }

  findOne(id: number) {
    return `This action returns a #${id} main`
  }

  update(id: number, updateMainDto: UpdateMainDto) {
    return `This action updates a #${id} main`
  }

  remove(id: number) {
    return `This action removes a #${id} main`
  }
}
